/**
 * Created by wangmiao on 14-12-9.
 */
 
document.body.addEventListener('touchstart', function () { });

var modal = {
	show:function(a,b,callback){
		a.css({"margin-left":-a.width()/2})
	  	a.show();
	  	a.animate({"top":"30%"},200);
	  	if($(".tck-cover").length==0){
			$("body").append('<div class="tck-cover"></div>');
			$(".tck-cover").fadeIn(200);
	  	};
	   	$(document).on("touchstart",".tck-cover",function(){
		   modal.hide(a);
	   	});
	   	b.on("click",function(){
		   modal.hide(a);
	   	});
		if(callback){
			callback();
		}
	},
	hide:function(e){
		e.animate({"top":"-50%"},0,function(){
			 e.hide();
		});
		$(".tck-cover").fadeOut(200);
		setTimeout(function(){$(".tck-cover").remove();},200)
	}
	
}












